import request from '@/utils/request'

export function getRolePermission(data) {
  return request({
    url: '/permission/findByRoleId',//后端不带项目名的地址
    method: 'get',
    params:data
  })
}
export function findByPage(query) {
  return request({
    url: '/permission/findByPage',
    method: 'get',
    params:query //表单数据
  })
}


export function deletePermission(permissionId) {
  return request({
    url: '/permission/deleteById',
    method: 'get',
    params:{"permissionId":permissionId}//form
  })
}
export function addPermission(data) {
  return request({
    url: '/permission/add',
    method: 'post',
    data//json
  })
}

export function updatePermission(data) {
  return request({
    url: '/permission/updateById',
    method: 'post',
    data//json
  })
}

export function findAllList() {
  return request({
    url: '/permission/findAllList',
    method: 'get'
  })
}
export function findAllPermissionList() {
  return request({
    url: '/permission/findAllPermissionList',
    method: 'get'
  })
}
export function findCheckedPermissionList(roleId) {
  return request({
    url: '/permission/findCheckedPermissionList',
    method: 'get',
    params:{"roleId":roleId}//form
  })
}